import catTick from '../../../src/scale/cat-tick';

describe('Scale controller', function() {
  it('tickCount 3', () => {
    const ticks = catTick({
      tickCount: 3,
      values: [ 1590076800000, 1590336000000, 1590422400000, 1590508800000, 1590595200000, 1590681600000, 1590940800000, 1591027200000, 1591113600000, 1591200000000, 1591286400000, 1591545600000, 1591632000000, 1591718400000, 1591804800000, 1591891200000, 1592150400000, 1592236800000, 1592323200000, 1592409600000, 1592496000000, 1592755200000, 1592841600000, 1592928000000 ]
    });
    expect(ticks).toEqual([ 1590076800000, 1591632000000, 1592928000000 ]);
  });

  it('tickCount 5', () => {
    const ticks = catTick({
      tickCount: 5,
      values: [ 1590076800000, 1590336000000, 1590422400000, 1590508800000, 1590595200000, 1590681600000, 1590940800000, 1591027200000, 1591113600000, 1591200000000, 1591286400000, 1591545600000, 1591632000000, 1591718400000, 1591804800000, 1591891200000, 1592150400000, 1592236800000, 1592323200000, 1592409600000, 1592496000000, 1592755200000, 1592841600000, 1592928000000 ]
    });
    expect(ticks).toEqual([ 1590076800000, 1590940800000, 1591632000000, 1592323200000, 1592928000000 ]);
  });

  it('values 2', () => {
    const ticks = catTick({
      tickCount: 3,
      values: [ 1590076800000, 1591632000000 ]
    });
    expect(ticks).toEqual([ 1590076800000, 1591632000000 ]);
  });


  it('values 1', () => {
    const ticks = catTick({
      tickCount: 3,
      values: [ 1590076800000 ]
    });
    expect(ticks).toEqual([ 1590076800000 ]);
  });

});
